# Maintainer: David Runge <dvzrv@archlinux.org>

_name=jaraco.logging
pkgname=python-jaraco.logging
pkgver=3.1.2
pkgrel=2
pkgdesc="Quickly solicit log level info from command-line parameters"
arch=(any)
url="https://github.com/jaraco/jaraco.logging"
license=(MIT)
depends=(python-tempora)
makedepends=(python-build python-installer python-setuptools python-setuptools-scm python-toml python-wheel)
conflicts=(python-jaraco)
replaces=(python-jaraco)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha256sums=('93a70b8b3767779ad6c7b56ee98579ced77b69f16abbcae749f62c2c59e67931')
b2sums=('add8236bdf345d55186d8ab7432c2b392df6921229c23c253a3b224d0362073c417cd4c0540e28117a1331adea15d4e8a17ad72c2cf7084375a19c64c529ccc0')

build() {
  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver

  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  # NOTE: there are actually no tests to run
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -vDm 644 *.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}
